<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../../react18/react.development.js"></script>
    <script src="../../react18/react-dom.development.js"></script>
    <script src="../../react18/babel.min.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/babel">
      //   const vDOM = React.createElement("span", {}, "你好");

      //   const root = ReactDOM.createRoot(document.getElementById("app"));

      //   root.render(vDOM);

      //   const vDOM = {
      //     tag: "div",
      //     props: {
      //       class: "box",
      //     },
      //     children: [
      //       {
      //         tag: "p",
      //         props: {},
      //         children: "我是p元素",
      //       },
      //       {
      //         tag: "span",
      //         props: {},
      //         children: "我是span元素",
      //       },
      //     ],
      //   };

      //   const vDOMp = React.createElement("p", {}, "我是p啊");
      //   const vDOMdiv = React.createElement("p", {}, "我是div", vDOMp);
      //   const vDOM = React.createElement(
      //     "div",
      //     {
      //       id: "box",
      //       width: "40px",
      //     },
      //     "我是大div",
      //     vDOMdiv
      //   );
      //   ReactDOM.createRoot(document.getElementById("app")).render(vDOM);
      let name = "许超";
      const vDOM = (
        <div
          className="div"
          style={{ backgroundColor: "yellow", width: "300px", height: "300px" }}
        >
          <h3>我的名字是{name}</h3>
        </div>
      );
      ReactDOM.createRoot(document.getElementById("app")).render(vDOM);
    </script>
  </body>
</html>
